
if SERVER then
	local function conIn(ply, command, args)
			local wholeThing = table.concat(args, " ")
			local space = string.find(wholeThing, " ")
			if not space then
				space = string.len(wholeThing) + 1
			end
			local name = string.sub(wholeThing, 1, space - 1)
			local par = {ply, wholeThing, string.sub(wholeThing, space + 1, string.len(wholeThing)), nil}
			executeFunc(name, par)
	end
	concommand.Add("moocow", conIn)
	concommand.Add("moocowcl", conIn)
else
	local function getAutoComplete(commandName, args)
		local commands = getMOOCommands()
		local ret = {}
		
		for cmd, val in pairs(commands) do
			if string.find(cmd, string.Trim(string.lower(args))) then
				table.insert(ret, "moocow " .. cmd)
			end
		end
		
		return ret
	end

	local function conIn(ply, command, args)
		RunConsoleCommand("moocowcl", table.concat(args, " "))
	end
	concommand.Add("moocow", conIn, getAutoComplete)
end